package com.linyaonan.leetcode.medium._1476;

class SubrectangleQueries {

    int[][] p = null;

    public SubrectangleQueries(int[][] rectangle) {
        p = rectangle;
    }
    
    public void updateSubrectangle(int row1, int col1, int row2, int col2, int newValue) {
        for (int i = row1; i <= row2; i++) {
            for (int j = 0; j <= col2; j++) {
                p[i][j] = newValue;
            }
        }
    }
    
    public int getValue(int row, int col) {
        return p[row][col];
    }
}